﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RPGX.Data.Repositories;

namespace RPGX.Data.Factories
{
    public static class PlayerRepositoryFactory
    {
        #region Properties

        public static IPlayerRepository PlayerRepository
        {
            get { return PlayerRepositoryFactory._playerRepository; }
            set { PlayerRepositoryFactory._playerRepository = value; }
        }
        private static IPlayerRepository _playerRepository = null;

        #endregion

        #region Public Static Methods

        public static void SetRepository(IPlayerRepository repository)
        {
            PlayerRepositoryFactory.PlayerRepository = repository;
        }

        public static IPlayerRepository GetRepository()
        {
            return PlayerRepositoryFactory.PlayerRepository ?? new PlayerRepository();
        }

        #endregion
    }
}
